﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using COMOSOFT.Class;
using DevExpress.XtraGrid.Views.Grid;

namespace COMOSOFT.Production.Forms
{
    public partial class FrmProductionInventory : Form
    {
        FrmPreviewInventory PvInvt = null;
        public FrmProductionInventory()
        {
            InitializeComponent();
        }
        public void LoadData()
        {
            sp_ProductionInventoryTableAdapter.Fill(this.dataSet_Delivery.sp_ProductionInventory);
            bandedGridView_Inventory.BandPanelRowHeight = 20;
           // bandedGridView_Inventory.BandPanelRowHeight = 30;
            bandedGridView_Inventory.ColumnPanelRowHeight = 30;
        }

        private void previewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (PvInvt != null && !PvInvt.IsDisposed)
            {
                PvInvt.Select();
                PvInvt.LoadData();
            }
            else
            {
                PvInvt = new FrmPreviewInventory(bandedGridView_Inventory);
                PvInvt.LoadData();
                PvInvt.Show();
            }
        }

        private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LoadData();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }       
    }
}
